<p class="Paragraph">If the form has a subform, the subform also reacts to events in the parent form.</p>
<p class="Paragraph">Linking an event with a macro makes sense if you have to repeatedly react to a very specific event in the form in a very specific way. To do so, first write a macro that contains all the commands to be executed when the event happens; then assign this macro to the respective event. For this purpose, simply click the <span class="T1">... </span><text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>button beside the respective event; a <help:link Id="67665" xmlns:help="http://openoffice.org/2000/help">dialog</help:link> will then open where you can select the macro.</p>
<p class="Paragraph">The following actions can be configured individually, i.e. you can use your own dialogs to depict an action:</p>
<ul class="L1">
<li class="">
<p class="P2">Displaying an error message,</p>
</li>
</ul>
<ul class="L2">
<li class="">
<p class="P3">Confirming a delete process (for data records),</p>
</li>
</ul>
<ul class="L3">
<li class="">
<p class="P4">Querying parameters,</p>
</li>
</ul>
<ul class="L4">
<li class="">
<p class="P5">Checking input when saving a data record.</p>
</li>
</ul>
<p class="Paragraph">This means, for example, you can issue a "confirm deletion" request such as "Really delete customer xyz?" when deleting a data record.</p>
<p class="Paragraph">In the following, all events defined for a form that can be linked to a macro are described:</p>
<p class="Paragraph"><help:help-text value="visible">This event occurs before a formula is reset.</help:help-text> The linked macro can, for example, prevent this action by returning "FALSE".</p>
<p class="Paragraph">A formula is reset if one of the following conditions is met:</p>
<ul class="L5">
<li class="">
<p style="">The user presses an (HTML) button that is defined as a reset button</p>
</li>
<li class="">
<p style="">A new and empty record is created in a formula that is linked to a data source. In the last record, for example, the <span style="font-weight:bold;">Next Record</span> button may be pressed.</p>
<p class="Paragraph"><help:help-text value="visible">This event occurs before the control content changed by the user is written into the data source.</help:help-text> The linked macro can, for example, prevent this action by returning "FALSE".</p>
<p class="Paragraph"><help:help-text value="visible">This event occurs after the control content changed by the user has been written into the data source.</help:help-text></p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs before the formula data is sent.</help:help-text></p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs directly after the formula has been loaded.</help:help-text></p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs before this formula is reloaded.</help:help-text> The data content has not yet been refreshed.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs directly after this formula has been reloaded.</help:help-text> The data content has already been refreshed.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs before this formula is unloaded, that is, separated from its data source.</help:help-text></p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs directly after this formula is unloaded, that is, separated from its data source.</help:help-text></p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs as soon as data is deleted from the formula.</help:help-text> The linked macro can, for example, request confirmation in a dialog.</p>
<p class="Head2"><help:help-id value="HID_EVT_APPROVEROWCHANGE" xmlns:help="http://openoffice.org/2000/help"/>Before record action</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs before the current record is changed, for example, by editing, deleting or pasting.</help:help-text> The linked macro can, for example, request confirmation in a dialog.</p>
<p class="Head2"><help:help-id value="HID_EVT_ROWCHANGE" xmlns:help="http://openoffice.org/2000/help"/>After record action</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs directly after the current record has been changed, for example, by editing, deleting or inserting.</help:help-text></p>
<p class="Head2"><help:help-id value="HID_EVT_POSITIONING" xmlns:help="http://openoffice.org/2000/help"/>Before record change</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs before the current record pointer is changed, for example, via the <span class="T1">Next Record</span> button</help:help-text>. The linked macro can, for example, prevent this action by returning "FALSE".</p>
<p class="Head2"><help:help-id value="HID_EVT_POSITIONED" xmlns:help="http://openoffice.org/2000/help"/>After record change</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs directly after the current record pointer is changed, for example, via the <span class="T1">Next Record</span> button</help:help-text>.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs when the formula to be loaded has parameters that must be filled out.</help:help-text> The data source of the formula can, for example, be the following SQL command:</p>
<p class="Paragraph">SELECT * FROM address WHERE name=:name</p>
<p class="Paragraph">:name is a parameter that must be filled out when loading. The parameter is automatically filled out from the principal formula as long as this is possible. If the parameter cannot be filled out, this event is called and a linked macro can fill out the parameter.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This event occurs if an error occurs when accessing the data source.</help:help-text> This applies to formulas, list boxes and combo boxes.</p>